# $Id: PKGBUILD 82561 2013-01-20 23:41:34Z dwallace $
# Maintainer: Daniel Wallace <danielwallace at gtmanfred dot com>
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: mlq <mlq@pwmt.org>

pkgbase=girara
pkgname=(girara-common girara-gtk2 girara-gtk3)
pkgver=0.1.5
pkgrel=1
pkgdesc="user interface library"
arch=('i686' 'x86_64')
url="http://pwmt.org/projects/girara"
license=('custom')
makedepends=('gtk3' 'gtk2')
source=(http://pwmt.org/projects/girara/download/girara-$pkgver.tar.gz)
md5sums=('fe725fd935c85657008c18bb07c671d4')

build() {
  true
}

package_girara-common() {
  depends=()
  pkgdesc="user interface library - common files"

  cd "$srcdir/girara-$pkgver"

  make clean

  # install header
  make DESTDIR="$pkgdir/" install-headers

  # install language files
  make DESTDIR="$pkgdir/" -C po install

  # remove pkgconfig files
  rm -r $pkgdir/usr/lib/pkgconfig

  # install license
  install -D -m664 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_girara-gtk2() {
  depends=('gtk2' 'girara-common')
  provides=('girara')

  cd "$srcdir/girara-$pkgver"

  make clean
  make GIRARA_GTK_VERSION=2

  # install files
  make GIRARA_GTK_VERSION=2 DESTDIR="$pkgdir/" install

  # remove common files
  rm -r "$pkgdir/usr/include"
  rm -r "$pkgdir/usr/share"

  # install license
  install -D -m664 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_girara-gtk3() {
  depends=('gtk3' 'girara-common')
  provides=('girara')

  cd "$srcdir/girara-$pkgver"

  make clean
  make GIRARA_GTK_VERSION=3

  # install files
  make GIRARA_GTK_VERSION=3 DESTDIR="$pkgdir/" install

  # remove common files
  rm -r "$pkgdir/usr/include"
  rm -r "$pkgdir/usr/share"

  # install license
  install -D -m664 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
